package com.elvis.springaopinaction.config;

/**
 * 测试装饰者模式
 */
public class DecorarorMilkTeaTest {
    public static void main(String[] args) {
        MikeTeaImpl man = new MikeTeaImpl();
        ConcreteCreamMilkTea md1 = new ConcreteCreamMilkTea(man);
        ConcretePearlMilkTea md2 = new ConcretePearlMilkTea(man);

        // 珍珠奶茶
        md1.makeMilkTea();
        System.out.println();
        // 椰奶奶茶
        md2.makeMilkTea();
        System.out.println();
        // 珍珠椰奶奶茶
        md1.setIMikeTea(md2);
        md1.makeMilkTea();
    }
}
